package com.ives.launcher.view;

import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import android.widget.RelativeLayout;

/**
 * 菜单页面顶部菜单
 * @author ives
 *
 */
public class View_Apps_TopMenu extends RelativeLayout{
	//三个按钮
		MyButton leftBtn,centerBtn,rightBtn;
		public View_Apps_TopMenu(Context context, AttributeSet attrs,int defStyle) {
			super(context, attrs, defStyle);
			init();
		}

		public View_Apps_TopMenu(Context context, AttributeSet attrs) {
			this(context, attrs, 0);
		}

		public View_Apps_TopMenu(Context context) {
			this(context, null);
		}
		private void init(){
			leftBtn = new MyButton(getContext());
			centerBtn = new MyButton(getContext());
			rightBtn = new MyButton(getContext());
			
			RelativeLayout.LayoutParams params_left = new LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.FILL_PARENT);
			RelativeLayout.LayoutParams params_center = new LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.FILL_PARENT);
			RelativeLayout.LayoutParams params_right = new LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.FILL_PARENT);
			
			params_left.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
			params_left.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
			
			params_center.addRule(RelativeLayout.CENTER_IN_PARENT);
			params_center.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
			
			params_right.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
			params_right.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
			this.addView(leftBtn,params_left);
			this.addView(centerBtn,params_center);
			this.addView(rightBtn,params_right);
			
		}

	}
